﻿using System;
using System.Data;
using Dapper;
using IceZero.DataStore.Models;
using MySql.Data.MySqlClient;
using Newtonsoft.Json;

namespace IceZero.DapperCmd
{
    class Program
    {
        private static IDbConnection GetConn()
        {
            var connStr = "Database=icezero;Data Source=localhost;User Id=root;Password=123456;Port=3306;Protocol=sockets;Pooling = true; Max Pool Size = 32767; Min Pool Size = 10; CharSet = utf8; ";
            var conn = new MySqlConnection(connStr);
            conn.Open();
            return conn;
        }
        static void Main(string[] args)
        {
            var conn = GetConn();
            var result = conn.Query<OperationAction>(" from IceZero_OperationAction", new { Id= "00000000000000000000000000000001" });
            Console.WriteLine(JsonConvert.SerializeObject(result));
        }
    }
}
